<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>系统首页</title>
	<link rel="stylesheet" href="/layui/css/layui.css">
	<link rel="stylesheet" href="/hyqcss/public.css">
	<style type="text/css">
		/*-----------------初始化-------------*/
		*{
			margin: 0;
			padding: 0;
		}
		body{
			font-family: "Microsoft YaHei";
		}
		h1,h2,h3,h4,h5,h6,b{
			font-weight: normal;
		}
		li{
			list-style: none;
		}
		a{
			text-decoration: none;
		}
		/*----------------button公共部分----------------*/
		.form-btn-container-h{
			
		}
		.btn-h{
			box-sizing: border-box;
			height: 32px;
			min-width: 90px;
			font-size: 14px;
			display: inline-block;
			text-align: center;
			border-radius: 2px;
			border: none;
			line-height: 32px;
			outline: none;
			color: #fff;
			width: 90px;
			cursor: pointer;
		}
		.btn-success-h{
			background: #1E9FFF;
		}
		.btn-warning-h{
			background: #f0ad4e;
		}
		.btn-danger-h{
			background: #d9534f;
		}
		.btn-default-h{
			background: #fff;
			color: #333 !important;
			border: 1px solid #ddd !important;
		}
		/*-----------flex公共部分----------*/
		.flex-h{
			display: flex;
		}
		.flex-d-col-h{
			flex-direction: column;
		}
		.flex-ai-center-h{
			align-items: center;
		}
		/*----------------内边距外边距公共部分-----------------*/
		.pl-130-h{
			padding-left: 130px!important;
		}
		.pb-100-h{
			padding-bottom: 100px!important;
		}
		.pt-40-h{
			padding-top: 40px!important;
		}
		.mat-10-h{
			margin-top: 10px !important;
		}
		.mat-20-h{
			margin-top: 20px !important;
		}
		.mat-50-h{
			margin-top: 50px !important;
		}
		.mal-20-h{
			margin-left: 20px !important;
		}
		.mal-60-h{
			margin-left: 60px !important;
		}
		.mal-2Percent-h{
			margin-left: 2% !important;
		}
		.mar-5-h{
			margin-right: 5px !important;
		}
		.mar-10-h{
			margin-right: 10px !important;
		}
		.mar-20-h{
			margin-right: 20px !important;
		}
		.mab-20-h{
			margin-bottom: 20px !important;
		}

		/*-------------非公共部分-------------*/
		.search-container-h{
			display: flex;
		}
		.search-content-h{
			display: flex;
		}
		.search-lable-h{
			display: block;
			height: 32px;
			line-height: 32px;
			margin-right: 6px;
			font-size: 14px;
			font-weight: 400;
			text-align: right;
			color: rgba(0, 0, 0, 0.65);
		}
		.search-inptu-h{
			font-size: 14px;
			padding: 0px 11px;
			height: 30px;
			color: rgba(0, 0, 0, 0.65);
			background-color: #fff;
			border: 1px solid #d9d9d9;
			border-radius: 4px;
			transition: all .3s;
			list-style: none;
		}
		.empty-container-h img{
			width: 400px;
			display: block;
		}
		.empty-container-h p{
			color: #828282;
			font-size: 14px;
		}
		/*表格部分*/
		.table-title-h{
			display: flex;
			background: #fafafa;
			border: 1px solid #eee;
		}
		.table-title-h li{
			padding: 16px 6px;
			flex: 1;
			color: #000;
			font-size: 14px;
			font-weight: 700;
			text-align: center;
		}
		.table-content-h{
			display: flex;
			border: 1px solid #eee;
			border-top: none;
		}
		.table-content-h li{
			color: #595959;
			font-size: 12px;
			text-align: center;
			padding: 8px 6px;
			flex: 1;
			display: flex;
			justify-content: center;
			align-items: center;
		}
		.table-content-h li button{
			flex: 1;
			min-width: auto;
			width: auto;
			font-size: 12px;
			padding: 7px 0px;
			height: auto;
			line-height: normal;
		}
	</style>
</head>
<body  style="background: #e9e9e9;">
	<!--<h2 class="main-title-h2-h">成员群数据</h2>-->
	<div style="margin: 16px;">
	 <form  method="get" action="" name="Form" id="Form1" onsubmit="return validate_form(this)">
		<div class="search-container-h">
			<div class="search-content-h">
				<label class="search-lable-h">日期：</label>
				<input type="text" id="dates" class="search-inptu-h"  value="{$dates}" />	 
			</div>
		</div>
	</form>
	</div>

	<!-- 有数据显示的div -->
	<div class="" style="margin:16px;">
		<table class="layui-table" lay-skin="line" style="margin: 0;">
		    <thead>
		      <tr style="background: #fff;">
		      	<th>头像</th>
		      	<th>群主</th>
		      	<th>群总数</th>
		      	<th>新增群聊数</th>
		      	<th>有过消息的群聊数</th>
		      	<th>群成员总数</th>
		      	<th>新增群成员数</th>
		      	<th>发过消息的群成员数</th>
		      	<th>群聊消息总数</th>
		      </tr> 
		    </thead>
		    <tbody>
			{loop $res as $re}
			<tr>
				<td><img src="{$re->avatar}" style="weidth:35px;height:35px"/></td>
				<td>{$re->name}</li>
				<td>{$re->groupchatStatistic['chat_total']}</td>
				<td>{$re->groupchatStatistic['new_chat_cnt']}</td>
				<td>{$re->groupchatStatistic['chat_has_msg']}</td>
				<td>{$re->groupchatStatistic['member_total']}</td>
				<td>{$re->groupchatStatistic['new_member_cnt']}</td>
				<td>{$re->groupchatStatistic['member_has_msg']}</td>
				<td>{$re->groupchatStatistic['msg_total']}</td>
		    </tr>
			{/loop}
		    </tbody>
		</table>
		<!-- 数据显示的div -->
		<div class="empty-container-h flex-h flex-d-col-h flex-ai-center-h mat-50-h" style="display: none">
			<img src="http://weidogstest.oss-cn-beijing.aliyuncs.com/181a0c37c2c8e9fd701d18b906f63fde.png" style="width: 400px; display: block;">
			<p class="mat-10-h">没有数据哦~</p>
		</div>

		<div class="main-container-h pageing-container-h" style="padding-top: 20px;">
		  <div class="pageing-content-h">
		       <span>{$p->totalnum}条/{$p->totalpage}页</span> 
		   </div>
			<ul class="pageing-content-h">
		       {P weidogsadmin}
			</ul>
		</div>
	</div>
</body>
</html>
<script src="/cdn/jquery.js"></script>
<script src="/layui/layui.js"></script>
<script src="/layui/layui.all.js"></script>
<script src="/js/ajax.js"></script>
<script>
layui.use(['laydate'], function () {
    var laydate = layui.laydate;
    window.laydate = laydate;
    laydate.render({
        elem: '#dates'
       ,type: 'date'
	   ,min: -90 //最小90天前
	   ,max: -1 //最大1天前
	   ,showBottom: false
	   ,done: function(value, date, endDate){
			//console.log(value); //得到日期生成的值，如：2017-08-18
			window.location.href='user_creat_groupchat_statistic.html?dates='+value;
		  }
      });
});
function tongbu_groupchat(){
	if(confirm('确定执行同步吗？')){
		myAjaxPost(false, true, 'tongbu_groupchat.html', '', function (resp) {
				if (resp.status == 'success') {
					tusi(resp.msg);
					setTimeout(function(){
						goto(location.href);
					},500);
				}else{
					alert(resp.msg);
				}
			});
	}
}

</script>